/* 暗黑主题基础样式 */
body {
    font-family: Arial, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: #1a1a1a;
    color: #e0e0e0;
}

.container {
    background-color: #2d2d2d;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    margin-bottom: 20px;
}

h1, h2 {
    color: #fff;
    margin-bottom: 20px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #e0e0e0;
}

input[type="text"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #444;
    border-radius: 4px;
    background-color: #333;
    color: #e0e0e0;
    box-sizing: border-box;
}

select {
    width: 100%;
    padding: 8px;
    border: 1px solid #444;
    border-radius: 4px;
    background-color: #333;
    color: #e0e0e0;
}

/* 脚本列表样式 */
.script-list {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 10px;
}

.script-item {
    background-color: #333;
    padding: 15px;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border: 1px solid #444;
}

.script-info {
    flex-grow: 1;
    font-size: 0.9em;
}

.script-info strong {
    display: block;
    margin-bottom: 8px;
    color: #fff;
    font-size: 1.1em;
}

.script-file-select, .venv-select {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 5px 0;
}

.script-file-select select, .venv-select select {
    flex: 1;
    padding: 6px;
    font-size: 0.9em;
    border: 1px solid #444;
    border-radius: 4px;
    background-color: #2d2d2d;
    color: #e0e0e0;
}

.script-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.script-actions button, .script-actions a {
    flex: 1;
    min-width: 60px;
    padding: 8px 12px;
    font-size: 0.9em;
    text-align: center;
    white-space: nowrap;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    color: #fff;
    text-decoration: none;
}

/* 按钮样式 */
.run-btn {
    background-color: #2196F3;
}

.run-btn:hover {
    background-color: #1976D2;
}

.delete-btn {
    background-color: #f44336;
}

.delete-btn:hover {
    background-color: #d32f2f;
}

.manage-btn {
    background-color: #ff9800;
}

.manage-btn:hover {
    background-color: #f57c00;
}

.download-btn {
    background-color: #009688;
}

.download-btn:hover {
    background-color: #00796b;
}

/* 消息提示样式 */
.flash-messages {
    list-style: none;
    padding: 0;
    margin-bottom: 20px;
}

.flash-message {
    padding: 12px;
    background-color: #333;
    color: #e0e0e0;
    border-radius: 4px;
    margin-bottom: 8px;
    border-left: 4px solid #4CAF50;
}

/* 导航栏样式 */
.header-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background-color: #2d2d2d;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.header-nav h1 {
    margin: 0;
    color: #fff;
}

.nav-links {
    display: flex;
    gap: 10px;
}

.nav-btn {
    background-color: #2196F3;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    border: none;
}

.nav-btn:hover {
    background-color: #1976D2;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 响应式布局 */
@media (max-width: 768px) {
    .script-list {
        grid-template-columns: 1fr;
    }
    
    .script-actions {
        flex-direction: row;
    }
    
    .script-actions button, .script-actions a {
        flex: 1;
    }
}

@media (min-width: 769px) and (max-width: 1200px) {
    .script-list {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

/* 禁用状态的运行按钮 */
.run-btn:disabled {
    background-color: #666;
    cursor: not-allowed;
}

/* 输出容器样式 */
.output-container {
    display: none;
    margin-top: 10px;
    padding: 10px;
    background-color: #1a1a1a;
    border-radius: 4px;
    color: #e0e0e0;
    max-height: 500px;
    overflow-y: auto;
}

.output-area {
    margin: 10px 0;
    padding: 10px;
    background-color: #000;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 400px;
    overflow-y: auto;
}

.error-output {
    color: #ff6b6b;
}

.run-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    margin-bottom: 8px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.running {
    background-color: #ffd700;
    animation: pulse 1s infinite;
}

.status-dot.success {
    background-color: #4caf50;
}

.status-dot.error {
    background-color: #ff6b6b;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

.history-btn {
    margin-top: 10px;
    padding: 6px 12px;
    background-color: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.history-btn:hover {
    background-color: #1976D2;
}

/* 历史记录对话框样式 */
.history-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.history-dialog-content {
    background-color: #2d2d2d;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.history-dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #444;
}

.history-dialog-header h3 {
    margin: 0;
    color: #fff;
}

.close-btn {
    background: none;
    border: none;
    color: #e0e0e0;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: #fff;
}

.history-list {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(90vh - 70px);
}

.history-item {
    background-color: #333;
    border-radius: 6px;
    margin-bottom: 10px;
    overflow: hidden;
    border: 1px solid #444;
}

.history-item.success {
    border-left: 3px solid #4caf50;
}

.history-item.error {
    border-left: 3px solid #f44336;
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background-color: #2d2d2d;
    border-bottom: 1px solid #444;
}

.history-timestamp {
    color: #e0e0e0;
    font-size: 0.9em;
}

.history-duration {
    color: #bbb;
    font-size: 0.9em;
}

.expand-history-btn {
    background-color: #444;
    color: #e0e0e0;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
}

.expand-history-btn:hover {
    background-color: #555;
}

.history-detail {
    display: none;
    padding: 15px;
    background-color: #1a1a1a;
}

.history-detail.expanded {
    display: block;
}

.no-history {
    text-align: center;
    color: #888;
    padding: 20px;
}

.no-output {
    color: #888;
    text-align: center;
    padding: 10px;
}

/* 输出内容样式 */
.output-section {
    margin: 10px 0;
    background-color: #2d2d2d;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #444;
}

.output-header {
    padding: 8px 12px;
    background-color: #333;
    color: #e0e0e0;
    font-weight: bold;
    border-bottom: 1px solid #444;
}

.output-content {
    margin: 0;
    padding: 12px;
    max-height: 300px;
    overflow-y: auto;
    background-color: #1a1a1a;
}

.error-message {
    color: #f44336;
    padding: 8px;
    background-color: rgba(244, 67, 54, 0.1);
    border-radius: 4px;
    margin: 10px 0;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.return-code {
    margin-top: 10px;
    padding: 8px;
    background-color: #333;
    border-radius: 4px;
    color: #e0e0e0;
    border: 1px solid #444;
}

/* 停止按钮样式 */
.stop-btn {
    background-color: #f44336;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 10px;
    font-size: 14px;
}

.stop-btn:hover {
    background-color: #d32f2f;
}

.stop-btn:disabled {
    background-color: #666;
    cursor: not-allowed;
}

.system-resources {
    padding: 20px;
    margin: 20px;
    background-color: #2d2d2d;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.system-resources h2 {
    color: #e0e0e0;
    margin-bottom: 20px;
}

.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.resource-card {
    background-color: #333;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
    border: 1px solid #444;
}

.resource-card h3 {
    margin: 0 0 15px 0;
    color: #e0e0e0;
    font-size: 1.1em;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background-color: #1a1a1a;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
    border: 1px solid #444;
}

.progress {
    height: 100%;
    background-color: #4CAF50;
    width: 0;
    transition: width 0.3s ease;
}

#cpu-progress { background-color: #2196F3; }
#memory-progress { background-color: #FF9800; }
#disk-progress { background-color: #9C27B0; }

.resource-card div:not(.progress-bar):not(.progress) {
    margin-top: 8px;
    font-size: 0.9em;
    color: #bbb;
}

#running-scripts {
    font-size: 2em;
    color: #2196F3;
    margin-top: 15px;
    text-shadow: 0 0 10px rgba(33, 150, 243, 0.3);
}

.table-container {
    overflow-x: auto;
    margin-top: 20px;
}

.scripts-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #2d2d2d;
    border-radius: 8px;
    overflow: hidden;
}

.scripts-table th,
.scripts-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #444;
}

.scripts-table th {
    background-color: #1a1a1a;
    color: #e0e0e0;
    font-weight: bold;
    white-space: nowrap;
}

.scripts-table td {
    color: #e0e0e0;
}

.scripts-table tr:hover {
    background-color: #383838;
}

.scripts-table .run-file-select,
.scripts-table .venv-select {
    width: 100%;
    padding: 6px;
    background-color: #333;
    border: 1px solid #444;
    color: #e0e0e0;
    border-radius: 4px;
}

.scripts-table .action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.scripts-table .action-buttons button,
.scripts-table .action-buttons a {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    color: white;
    text-decoration: none;
    font-size: 14px;
    text-align: center;
    min-width: 80px;
}

.scripts-table .run-btn { background-color: #2196F3; }
.scripts-table .run-btn:hover { background-color: #1976D2; }

.scripts-table .manage-btn { background-color: #ff9800; }
.scripts-table .manage-btn:hover { background-color: #f57c00; }

.scripts-table .download-btn { background-color: #009688; }
.scripts-table .download-btn:hover { background-color: #00796b; }

.scripts-table .delete-btn { background-color: #f44336; }
.scripts-table .delete-btn:hover { background-color: #d32f2f; }

.scripts-table .output-row {
    background-color: #1a1a1a;
}

.scripts-table .output-container {
    padding: 0;
    margin: 0;
    border: none;
    background-color: transparent;
}

.scripts-table .output-container:not(:empty) {
    padding: 12px;
    margin: 8px 0;
    background-color: #333;
    border-radius: 4px;
}

/* 搜索框样式 */
.search-box {
    margin: 20px 0;
}

.search-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #444;
    border-radius: 4px;
    background-color: #333;
    color: #e0e0e0;
    font-size: 14px;
}

.search-input:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}

.search-btn {
    padding: 8px 16px;
    background-color: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.search-btn:hover {
    background-color: #1976D2;
}

.clear-search {
    padding: 8px 16px;
    background-color: #666;
    color: white;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
}

.clear-search:hover {
    background-color: #555;
}

/* 脚本计数样式 */
.scripts-count {
    margin: 10px 0;
    color: #bbb;
    font-size: 14px;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.page-btn {
    padding: 6px 12px;
    background-color: #333;
    color: #e0e0e0;
    border: 1px solid #444;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    min-width: 36px;
    text-align: center;
}

.page-btn:hover {
    background-color: #444;
}

.page-btn.current {
    background-color: #2196F3;
    color: white;
    border-color: #2196F3;
    cursor: default;
}

.page-dots {
    color: #666;
    padding: 6px 4px;
}

@media (max-width: 768px) {
    .search-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-input,
    .search-btn,
    .clear-search {
        width: 100%;
    }
    
    .pagination {
        gap: 4px;
    }
    
    .page-btn {
        padding: 4px 8px;
        min-width: 32px;
    }
}

.script-header strong {
    color: #4CAF50;
    font-size: 1.1em;
    font-weight: 600;
    text-shadow: 0 0 1px rgba(76, 175, 80, 0.3);
}

.script-header:hover strong {
    color: #81C784;
}

.script-jump {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: #2d2d2d;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.script-jump select {
    background: #333;
    color: #fff;
    border: 1px solid #444;
    padding: 8px;
    border-radius: 4px;
    width: 200px;
    font-size: 0.9em;
}

.script-jump select:focus {
    outline: none;
    border-color: #4CAF50;
}

.script-jump label {
    display: block;
    margin-bottom: 5px;
    color: #aaa;
    font-size: 0.9em;
} 